package com.lsk.apipassenger.controller;

import com.lsk.apipassenger.service.TokenService;
import com.lsk.internalcommon.DTO.ResponseResult;
import com.lsk.internalcommon.request.TokenRequest;
import com.lsk.internalcommon.response.TokenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TokenController {
    @Autowired
    private TokenService tokenService;

    @PostMapping("/token-refresh")
    public ResponseResult refreshToken(@RequestBody TokenResponse tokenResponse){
        String refreshToken = tokenResponse.getRefreshToken();


        return tokenService.refreshToken(refreshToken);

    }
}
